package model.type;

import java.util.HashMap;

import db.SubjectTypeDAO;

public class SubjectType {		
	public static final int PERSON = 1, ENTERPRISE = 2,  EMPLOYEE = 3, CUSTOMER = 4; 	
	
	private static HashMap<Integer, SubjectType> map 
	= new HashMap<Integer, SubjectType>();
	
	private int id;
	private String type;	

	// LOAD EVERYTHING INTO HASHMAP FOR QUICK REFERENCE IN THE FUTURE
	static{		
		for(SubjectType t: SubjectTypeDAO.getAll()){
			map.put(t.getId(), t);
		}		
	}
	
	public static SubjectType getSubjectType(int id){
		return map.get(id);
	}
	
	public SubjectType(int id, String type) {
		this.id = id;
		this.type = type;
	}
	
	public int getId() {
		return id;
	}

	public String getType() {
		return type;
	}	
}
